{extend name="admin@index_layout"/}
{block name="main"}
<form class="layui-form" method="post">
    <input type="hidden" name="row[id]" value="{$data.id}" />
<!--    <div class="layui-form-item">-->
<!--        <label class="layui-form-label">会员类型</label>-->
<!--        <div class="layui-input-block" id="is_c3">-->

<!--            <input type="radio" name="type" checked value="1" title="集团会员" lay-filter="ccc3">-->

<!--            <input type="radio" name="type" value="2" title="付费会员" lay-filter="ccc3">-->
<!--        </div>-->
<!--    </div>-->

    <div class="layui-form-item">
        <label class="layui-form-label">会员卡名称</label>
        <div class="layui-input-block">
            <input type="text" name="row[name]" value="{$data.name}" lay-verify="required" autocomplete="off" placeholder="会员卡名称"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item" >
        <label class="layui-form-label">图片</label>
        <div class="layui-input-block">
            <input type="text" name="row[img]" id="c-pic" class="layui-input" value="{$data.img}">
        </div>
        <div class="layui-input-block">
            <button type="button" class="layui-btn faupload" id="faupload-pic" data-multiple="false" data-input-id="c-pic"
                    data-preview-id="p-pic" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic" id="fachoose-c-pic"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic"></ul>
        </div>
    </div>

    <div class="layui-form-item" >
        <label class="layui-form-label">会员背景</label>
        <div class="layui-input-block">
            <input type="text" name="row[bg_img]" id="c-pic2" class="layui-input" value="{$data.bg_img}">
        </div>
        <div class="layui-input-block">
            <button type="button" class="layui-btn faupload" id="faupload-pic2" data-multiple="false" data-input-id="c-pic2"
                    data-preview-id="p-pic2" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic2" id="fachoose-c-pic2"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic2"></ul>
        </div>
    </div>

    <div class="layui-form-item" >
        <label class="layui-form-label">会员图标</label>
        <div class="layui-input-block">
            <input type="text" name="row[icon_img]" id="c-pic3" class="layui-input" value="{$data.icon_img}">
        </div>
        <div class="layui-input-block">
            <button type="button" class="layui-btn faupload" id="faupload-pic3" data-multiple="false" data-input-id="c-pic3"
                    data-preview-id="p-pic3" data-type="image"><i class="layui-icon layui-icon-upload"></i> 上传
            </button>
            <button type="button" class="layui-btn fachoose" data-multiple="false" data-mimetype="image"
                    data-input-id="c-pic3" id="fachoose-c-pic3"><i class="iconfont icon-other"></i> 选择
            </button>
            <ul class="layui-row list-inline plupload-preview" id="p-pic3"></ul>
        </div>
    </div>


    <div class="layui-form-item free1">
        <label class="layui-form-label">会员天数</label>
        <div class="layui-input-block">
            <input type="text" name="row[day_num]" value="{$data.day_num}" lay-verify="number" autocomplete="off" placeholder="会员天数"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item free2" >
        <label class="layui-form-label">价格</label>
        <div class="layui-input-block">
            <input type="number" name="row[price]" value="{$data.price}" lay-verify="priceNum" autocomplete="off" placeholder="价格"
                   class="layui-input" min="0.01" step="0.01">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="row[sort]" value="{$data.sort}" lay-verify="required|number" autocomplete="off" placeholder="排序"
                   class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">简介</label>
        <div class="layui-input-block">
            <textarea name="row[desc]" placeholder="简介" class="layui-textarea">{$data.desc}</textarea>
        </div>
    </div>


    <div class="layui-form-item layer-footer">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit>立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
{/block}
{block name="script"}
<script type="text/javascript">
    layui.use(['yznForm', 'laydate','form'], function () {
        var yznForm = layui.yznForm,
            laydate = layui.laydate;
        var form = layui.form;
        var $ = layui.jquery;
        yznForm.bindevent($("form.layui-form"));

        form.on('radio(ccc3)',function (data){
            if($('#is_c3 input[name="type"]:checked ').val() ==1){
                $(".free1").hide();
                $(".free2").hide();
                $(".jt1").show();
            }else{
                $(".free1").show();
                $(".free2").show();
                $(".jt1").hide();
            }
            form.render();
        });

        laydate.render({
            elem: '#ID-laydate'
        });


    });
</script>
{/block}